https://leetcode-cn.com/problems/intersection-of-two-arrays/


class Solution {
public:
    vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
        unordered_set<int> result_set;
        unordered_set<int> nums1_set(nums1.begin(),nums1.end());
        for(int num2 : nums2)
        {
            if(nums1_set.find(num2) != nums1_set.end())
            {
                result_set.insert(num2);
            }
        }
        return vector<int>(result_set.begin(),result_set.end());
    }
};